<!doctype html>
<html>
<head>
    <!--Setting-->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="apple-mobile-web-app-capable"  content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no">
    
    
    <!--Simple SEO-->


<meta name="robots" content=all />
<meta name="google" content=all />
<meta name="googlebot" content=all />
<meta name="verify" content=all />
    <!--Title-->

<title>CentOS6搭建iscsi存储 | MIAbon&#39;s blog</title>

<link rel="alternate" href="/atom.xml" title="MIAbon&#39;s blog" type="application/atom+xml">


<link rel="icon" href="/favicon.ico">

    
<link rel="stylesheet" href="/css/base.css">
<link rel="stylesheet" href="/css/pages/post.css">
<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/thirdParty/highlight/github.css">
<link rel="stylesheet" href="/.css">

    <!--script-->


<script src="http://cdn1.lncld.net/static/js/3.2.1/av-min.js"></script>
<script>
  var appId = "i7AHmC7NPbPtgS3YxT67dRIc-9Nh9j0Va";
  var appKey = "g6TKbY8O4TsCDMcemoC3STvQ";
  var region = "";
  AV.init({
    appId: appId,
    appKey: appKey,
    region: region
  });
</script>


<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<!--<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>-->


    
    
</head>

<body id="normal">
<!--[if lte IE 8]>
<style>
    html{ font-size: 1em }
</style>
<![endif]-->
<!--[if lte IE 9]>
<style>
    header{ top: 71px; position: absolute!important;}
    #container{padding-top: 151px!important;}
</style>
<div style="position:fixed;z-index:9999;left:0;top:0;width:100%;height:70px;background-color:#e0e0e0;color:#396CA5;border-bottom:1px solid #cecece;text-align:center;line-height:70px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis">你使用的浏览器版本过低，为了你更好的阅读体验，请更新浏览器的版本或者使用其他现代浏览器，比如Chrome、Firefox、Safari等。</div>
<![endif]-->

<div id="wrap">
    <header  style="position: absolute;" >
    <div id="site-meta">
        <a href="/" id="logo">
            <h1 class="title">MIAbon&#39;s blog</h1>
        </a>
        
    </div>
    <ul id="nav">
        
            <li><a href="/"><i class="fa fa-home"></i>首页</a></li>
        
            <li><a href="/atom.xml"><i class="fa fa-rss"></i>RSS</a></li>
        
        <li id="search"><a href="javascript:void(0)"><i class="fa fa-search"></i>搜索</a></li>
    </ul>
</header>

    <div id="container">
        
<ul id="sidebar">
    
    
    
    
<li class="widget widget-normal category">
    <h3 class="fa fa-th widget-title">分类</h3>
    <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/ELK/"><i class="fa" aria-hidden="true">ELK</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Lvs/"><i class="fa" aria-hidden="true">Lvs</i></a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/admin/"><i class="fa" aria-hidden="true">admin</i></a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/ansible/"><i class="fa" aria-hidden="true">ansible</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/aws/"><i class="fa" aria-hidden="true">aws</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/docker/"><i class="fa" aria-hidden="true">docker</i></a><span class="category-list-count">7</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/drone/"><i class="fa" aria-hidden="true">drone</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/kernel/"><i class="fa" aria-hidden="true">kernel</i></a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/kubernetes/"><i class="fa" aria-hidden="true">kubernetes</i></a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/kvm/"><i class="fa" aria-hidden="true">kvm</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mongodb/"><i class="fa" aria-hidden="true">mongodb</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link current" href="/categories/python/"><i class="fa" aria-hidden="true">python</i></a><span class="category-list-count">9</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/share/"><i class="fa" aria-hidden="true">share</i></a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/web/"><i class="fa" aria-hidden="true">web</i></a><span class="category-list-count">12</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/zabbix/"><i class="fa" aria-hidden="true">zabbix</i></a><span class="category-list-count">3</span></li></ul>
</li>


    
    
<li class="widget widget-normal archive">
  <h3 class="fa fa-archive widget-title">归档</h3>
    <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/02/"><i class="fa" aria-hidden="true">二月 2018</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/01/"><i class="fa" aria-hidden="true">一月 2018</i></a><span class="archive-list-count">8</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/12/"><i class="fa" aria-hidden="true">十二月 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/11/"><i class="fa" aria-hidden="true">十一月 2017</i></a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/10/"><i class="fa" aria-hidden="true">十月 2017</i></a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/09/"><i class="fa" aria-hidden="true">九月 2017</i></a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/08/"><i class="fa" aria-hidden="true">八月 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/05/"><i class="fa" aria-hidden="true">五月 2017</i></a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/04/"><i class="fa" aria-hidden="true">四月 2017</i></a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/03/"><i class="fa" aria-hidden="true">三月 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/01/"><i class="fa" aria-hidden="true">一月 2017</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/12/"><i class="fa" aria-hidden="true">十二月 2016</i></a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/11/"><i class="fa" aria-hidden="true">十一月 2016</i></a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/10/"><i class="fa" aria-hidden="true">十月 2016</i></a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/"><i class="fa" aria-hidden="true">八月 2016</i></a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/05/"><i class="fa" aria-hidden="true">五月 2016</i></a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/"><i class="fa" aria-hidden="true">四月 2016</i></a><span class="archive-list-count">8</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/05/"><i class="fa" aria-hidden="true">五月 2015</i></a><span class="archive-list-count">1</span></li></ul>
</li>


    
    
<li class="widget widget-normal tags">
  <h3 class="fa fa-tags widget-title">标签云</h3>
  <div class="tagcloud-content">
    
      <a href="/tags/drone/" style="font-size: 0.14rem; color: #69c">drone</a> <a href="/tags/linux/" style="font-size: 0.2rem; color: #0a407c">linux</a> <a href="/tags/kernel/" style="font-size: 0.16rem; color: #4f83b8">kernel</a> <a href="/tags/ELK/" style="font-size: 0.14rem; color: #69c">ELK</a> <a href="/tags/ansible/" style="font-size: 0.14rem; color: #69c">ansible</a> <a href="/tags/swarm/" style="font-size: 0.14rem; color: #69c">swarm</a> <a href="/tags/docker/" style="font-size: 0.18rem; color: #215690">docker</a> <a href="/tags/firewalld/" style="font-size: 0.14rem; color: #69c">firewalld</a> <a href="/tags/zabbix/" style="font-size: 0.16rem; color: #4f83b8">zabbix</a> <a href="/tags/aws/" style="font-size: 0.14rem; color: #69c">aws</a> <a href="/tags/web/" style="font-size: 0.16rem; color: #4f83b8">web</a> <a href="/tags/python/" style="font-size: 0.18rem; color: #215690">python</a> <a href="/tags/spider/" style="font-size: 0.17rem; color: #386da4">spider</a>
  </div>
</li>


    
    
<li class="widget widget-normal friends-link">
    <h3 class="fa fa-globe widget-title">友链</h3><br/>

    
        <a href="http://zhengwei666.wang" class="fa" target="_blank">zhengwei</a>

    
        <a href="https://you-deng.github.io" class="fa" target="_blank">dengyou</a>

    
        <a href="http://www.systemd.cn" class="fa" target="_blank">langyaoliang</a>

    
        <a href="http://www.chen-hao.com.cn/" class="fa" target="_blank">chenhao</a>

    
        <a href="http://www.yulongjun.com" class="fa" target="_blank">yulongjun</a>

    

</li>

    
</ul>


        <div id="main">
    <article id="post">
        <div id="post-header">

            <h1 id="CentOS6搭建iscsi存储">
                
                CentOS6搭建iscsi存储
                
            </h1>
            <div class="article-meta">
    
    
    <span class="categories-meta fa-wrap">
            <i class="fa fa-folder-open-o"></i>
        <span>Lvs</span>
    </span>
    
    
    <span class="fa-wrap">
         <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            null
            
        </span>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta ">2016/05/09</span>
    </span>
    
    
    <span class="fa-wrap">
            <i class="fa fa-thermometer-three-quarters"></i>
        <span class="hits hits-meta " data-leadcloud-title="CentOS6搭建iscsi存储"
              data-leadcloud-url="/2016/05/09/CentOS6搭建iscsi存储/"><i class="fa fa-spinner fa-spin"></i></span>
    </span>
    
    
</div>

            
            
            <p class="fa fa-exclamation-triangle warning">
                本文于<strong>634</strong>天之前发表，文中内容可能已经过时。如有疑问，请在评论区留言。
            </p>
            
        </div>
        
        <div id="post-body">
            <h1 id="服务器端"><a href="#服务器端" class="headerlink" title="服务器端"></a>服务器端</h1><p>软件安装</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">yum -y install scsi-target-utils</div></pre></td></tr></table></figure>
<h2 id="查看包信息"><a href="#查看包信息" class="headerlink" title="查看包信息"></a>查看包信息</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line">rpm -qi scsi-target-utils</div><div class="line">Name        : scsi-target-utils            Relocations: (not relocatable)</div><div class="line">Version     : 1.0.24                            Vendor: CentOS</div><div class="line">Release     : 16.el6                        Build Date: Wed 15 Oct 2014 02:08:59 PM CST</div><div class="line">Install Date: Mon 09 May 2016 07:35:46 PM CST      Build Host: c6b9.bsys.dev.centos.org</div><div class="line">Group       : System Environment/Daemons    Source RPM: scsi-target-utils-1.0.24-16.el6.src.rpm</div><div class="line">Size        : 469782                           License: GPLv2</div><div class="line">Signature   : RSA/SHA1, Sat 18 Oct 2014 03:59:49 AM CST, Key ID 0946fca2c105b9de</div><div class="line">Packager    : CentOS BuildSystem &lt;http://bugs.centos.org&gt;</div><div class="line">URL         : http://stgt.sourceforge.net/</div><div class="line">Summary     : The SCSI target daemon and utility programs</div><div class="line">Description :</div><div class="line">The SCSI target package contains the daemon and tools to setup a SCSI targets.</div><div class="line">Currently, software iSCSI targets are supported.</div></pre></td></tr></table></figure>
<h2 id="查看安装包生成的文件"><a href="#查看安装包生成的文件" class="headerlink" title="查看安装包生成的文件"></a>查看安装包生成的文件</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div></pre></td><td class="code"><pre><div class="line">rpm -ql scsi-target-utils</div><div class="line">/etc/rc.d/init.d/tgtd</div><div class="line">/etc/sysconfig/tgtd <span class="comment">#指定服务配置文件路径</span></div><div class="line">/etc/tgt/targets.conf <span class="comment">#主要设定档，设定要分享的磁碟格式有哪几颗</span></div><div class="line">/usr/sbin/tgt-admin <span class="comment">#線上查詢、刪除 target 等功能的設定工具</span></div><div class="line">/usr/sbin/tgt-setup-lun <span class="comment">#建立 target以及設定分享的磁碟與可使用的用戶端等工具軟體</span></div><div class="line">/usr/sbin/tgtadm <span class="comment">#手動直接管理的管理員工具</span></div><div class="line">/usr/sbin/tgtd <span class="comment">#主要提供 iSCSI target 服務的主程式</span></div><div class="line">/usr/sbin/tgtimg <span class="comment">#建置預計分享的映像檔裝置的工具</span></div><div class="line">/usr/share/doc/scsi-target-utils-1.0.2</div><div class="line">/usr/share/doc/scsi-target-utils-1.0.24/README</div><div class="line">/usr/share/doc/scsi-target-utils-1.0.24/README.iscsi</div><div class="line">/usr/share/doc/scsi-target-utils-1.0.24/README.iser</div><div class="line">/usr/share/doc/scsi-target-utils-1.0.24/README.lu_configuration</div><div class="line">/usr/share/doc/scsi-target-utils-1.0.24/README.mmc</div><div class="line">/usr/share/man/man5/targets.conf.5.gz</div><div class="line">/usr/share/man/man8/tgt-admin.8.gz</div><div class="line">/usr/share/man/man8/tgt-setup-lun.8.gz</div><div class="line">/usr/share/man/man8/tgtadm.8.gz</div></pre></td></tr></table></figure>
<h2 id="查看hostname"><a href="#查看hostname" class="headerlink" title="查看hostname"></a>查看hostname</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">hostmane</div><div class="line">vim /etc/tgt/targets.conf</div><div class="line">&lt;target iqn.2016-05.localhost.localdomain:iscsi_test&gt;</div><div class="line">    backing-store /dev/sdb</div><div class="line">&lt;/target&gt;</div></pre></td></tr></table></figure>
<h2 id="开机启动"><a href="#开机启动" class="headerlink" title="开机启动"></a>开机启动</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">/etc/init.d/tgtd start</div><div class="line">chkconfig tgtd on</div></pre></td></tr></table></figure>
<h2 id="检查iscsi是否启动"><a href="#检查iscsi是否启动" class="headerlink" title="检查iscsi是否启动"></a>检查iscsi是否启动</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">ss -tnl <span class="comment">#查看3260端口是否打开</span></div></pre></td></tr></table></figure>
<h2 id="查看target信息"><a href="#查看target信息" class="headerlink" title="查看target信息"></a>查看target信息</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div></pre></td><td class="code"><pre><div class="line">tgt-admin --show </div><div class="line">Target 1: iqn.2016-05.localhost.localdomain:iscsi_test</div><div class="line">    System information:</div><div class="line">        Driver: iscsi</div><div class="line">        State: ready</div><div class="line">    I_T nexus information:</div><div class="line">    LUN information:</div><div class="line">        LUN: 0</div><div class="line">            Type: controller</div><div class="line">            SCSI ID: IET     00010000</div><div class="line">            SCSI SN: beaf10</div><div class="line">            Size: 0 MB, Block size: 1</div><div class="line">            Online: Yes</div><div class="line">            Removable media: No</div><div class="line">            Prevent removal: No</div><div class="line">            Readonly: No</div><div class="line">            Backing store <span class="built_in">type</span>: null</div><div class="line">            Backing store path: None</div><div class="line">            Backing store flags: </div><div class="line">        LUN: 1</div><div class="line">            Type: disk</div><div class="line">            SCSI ID: IET     00010001</div><div class="line">            SCSI SN: beaf11</div><div class="line">            Size: 10734 MB, Block size: 512</div><div class="line">            Online: Yes</div><div class="line">            Removable media: No</div><div class="line">            Prevent removal: No</div><div class="line">            Readonly: No</div><div class="line">            Backing store <span class="built_in">type</span>: rdwr</div><div class="line">            Backing store path: /dev/sdb</div><div class="line">            Backing store flags: </div><div class="line">    Account information:</div><div class="line">    ACL information:</div><div class="line">        ALL</div></pre></td></tr></table></figure>
<h1 id="客户端"><a href="#客户端" class="headerlink" title="客户端"></a>客户端</h1><p>iSCSI initiator必须要安装iscsi-initiator-utils<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">yum install -y iscsi-initiator-utils</div></pre></td></tr></table></figure></p>
<h2 id="查看安装的文件"><a href="#查看安装的文件" class="headerlink" title="查看安装的文件"></a>查看安装的文件</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">rpm -ql iscsi-initiator-utils</div><div class="line">/etc/iscsi/iscsid.conf <span class="comment">#主要设定档，用来连接到 iSCSI target 的设定；</span></div><div class="line">/sbin/iscsid <span class="comment">#启动 iSCSI initiator 的主要服务程式；</span></div><div class="line">/sbin/iscsiadm <span class="comment">#用来管理 iSCSI initiator 的主要设定程式；</span></div><div class="line">/etc/init.d/iscsid <span class="comment">#让本机模拟成为 iSCSI initiater 的主要服务；</span></div><div class="line">/etc/init.d/iscsi <span class="comment">#在本机成为 iSCSI initiator 之后，启动此脚本，让我们可以登入 iSCSI target。所以 iscsid 县启动后，才能启动这个服务。为了防呆，所以 /etc/					init.d/iscsi 已经写了一个启动指令， 启动 iscsi 前尚未启动 iscsid ，则会先呼叫 iscsid 才继续处理 iscsi</span></div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">iscsiadm -m discovery -t sendtargets -p 172.18.40.98</div><div class="line">172.18.40.98:3260,1 iqn.2016-05.localhost.localdomain:iscsi_test</div><div class="line">-m discovery   <span class="comment">#使用侦测的方式进行 iscsiadmin 指令的功能；</span></div><div class="line">-t sendtargets <span class="comment">#透过 iscsi 的协定，侦测后面的设备所拥有的 target 资料</span></div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">iscsiadm -m node</div><div class="line">-m node 	   <span class="comment">#找出目前本机上面所有侦测到的 target 资讯，可能并未登入</span></div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line">iscsiadm -m node -T iqn.2016-05.localhost.localdomain:iscsi_test --login</div><div class="line">Logging <span class="keyword">in</span> to [iface: default, target: iqn.2016-05.localhost.localdomain:iscsi_test, portal: 172.18.40.98,3260] (multiple)</div><div class="line">Login to [iface: default, target: iqn.2016-05.localhost.localdomain:iscsi_test, portal: 172.18.40.98,3260] successful.</div><div class="line">lsblk </div><div class="line">NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT</div><div class="line">sr0                  11:0    1 1024M  0 rom  </div><div class="line">sda                   8:0    0  120G  0 disk </div><div class="line">├─sda1                8:1    0  200M  0 part /boot</div><div class="line">└─sda2                8:2    0   60G  0 part </div><div class="line">  ├─vg0-root (dm-0) 253:0    0   20G  0 lvm  /</div><div class="line">  ├─vg0-swap (dm-1) 253:1    0    2G  0 lvm  [SWAP]</div><div class="line">  ├─vg0-usr (dm-2)  253:2    0   10G  0 lvm  /usr</div><div class="line">  └─vg0-var (dm-3)  253:3    0   20G  0 lvm  /var</div><div class="line">sdb                   8:16   0   10G  0 disk</div></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line">blkid</div><div class="line">/dev/sda1: UUID=<span class="string">"c1f784cd-3afe-4d7a-ad5f-0b1c32ca64fd"</span> TYPE=<span class="string">"ext4"</span> </div><div class="line">/dev/sda2: UUID=<span class="string">"8WzYs2-GJMN-YSwm-iqfp-EmUX-bV8Q-XKrNz4"</span> TYPE=<span class="string">"LVM2_member"</span> </div><div class="line">/dev/mapper/vg0-root: UUID=<span class="string">"4555f456-09b5-4f35-b9fb-4ab921219a51"</span> TYPE=<span class="string">"ext4"</span> </div><div class="line">/dev/mapper/vg0-swap: UUID=<span class="string">"6bdf25f7-d688-47a0-9a68-876cb33827d5"</span> TYPE=<span class="string">"swap"</span> </div><div class="line">/dev/mapper/vg0-usr: UUID=<span class="string">"c5d38edf-66bd-4691-9888-53dd4d45794f"</span> TYPE=<span class="string">"ext4"</span> </div><div class="line">/dev/mapper/vg0-var: UUID=<span class="string">"733f591c-03b5-4bbd-b5b2-932b233565d4"</span> TYPE=<span class="string">"ext4"</span> </div><div class="line">/dev/sdb1: UUID=<span class="string">"4505f84d-2aa6-48cd-8b0e-08de9f6f69d9"</span> TYPE=<span class="string">"ext4"</span></div></pre></td></tr></table></figure>
<h2 id="创建挂载点"><a href="#创建挂载点" class="headerlink" title="创建挂载点"></a>创建挂载点</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">mkdir -pv /mnt/iscsi</div><div class="line">mkdir: created directory `/mnt/iscsi`</div><div class="line">mount /dev/sdb /mnt/iscsi/</div></pre></td></tr></table></figure>
        </div>
        <div id="post-footer">
            <div class="avatar" >
                <img src="/img/author.jpg" alt="avatar"/>
                <!-- 
                <a href="javascript:void(0)" class="high-song">high起来 &#128541;</a>
                 -->
                
                <a href="http://backup-miabon.oss-cn-hongkong.aliyuncs.com/img/alipay.jpg" target="_blank" class="donate fa">打赏小弟 &#128536;</a>
                
            </div>
            <ul class="author-profile-section">
                <li>
                  
                  作者:
                  
                    
                    <a href="/about.html">MIAbon</a>
                </li>
                
                <li>发表日期: <span>2016-05-09  08:00:00</span></li>
                
                <li>最后编辑日期: <span>2017-11-23  08:23:00</span></li>
                
                <li class="post-category">
                    文章分类:
                    
                    <a href="/categories/Lvs/">Lvs</a>
                    
                </li>
                <li class="post-tags">
                    文章标签:
                    
                </li>
                
                <li> 版权声明: <a href="https://creativecommons.org/licenses/by-nc-nd/3.0/" target="_blank">
知识共享署名-非商业性使用-禁止演绎 3.0 未本地化版本许可协议（CC BY-NC-ND 3.0）
</a></li>
                
            </ul>
            <div id="donate-wrap">
                
                
                
                <img src="http://www.geasslinks.com/img/alipay.jpg" alt="支付宝付款" class="donate-img">
                
                
            </div>
        </div>
    </article>
    <div class="article-nav">
        
        <a href="/2016/05/16/memcached简易使用/" class="pre-post fa fa-caret-left">memcached简易使用</a>
        
        
        <a href="/2016/05/06/shadowsocks/" class="next-post fa">科学上网shadowsocks</a>
        
    </div>
    
    <div id="comments">
        

<script>
  gitment.render(document.getElementById("comments"));
</script>



    </div>
    
</div>


    </div>
    <footer id="footer">
    
    <div class="social">
        
        <a href="https://www.example1.com" class="fa fa-free-code-camp" target="_blank" title="freecodecamp"></a>
        
        <a href="https://github.com/werewolf2101" class="fa fa-github" target="_blank" title="Follow me~"></a>
        
        <a href="mailto:werewolf2101@gmail.com" class="fa fa-email" target="_blank" title="Email"></a>
        
    </div>
    
    <div>
        
        <a href="/" class="copyright-links">MIAbon</a>&copy;2015 - 2018.All Rights
        Reserved.
    </div>
    <p>Powered by <a href="https://hexo.io" class="copyright-links" target="_blank">Hexo</a> | Theme by <a
                href="https://github.com/GeekaholicLin" class="copyright-links" target="_blank">GeekaholicLin</a>
    </p>
    
    
    <p>
        <span id="busuanzi_container_site_uv" class="fa fa-bar-chart">
        欢迎第<span id="busuanzi_value_site_uv"><i class="fa fa-spinner fa-spin"></i></span>位小伙伴~
        </span>
    </p>
    
</footer>

</div>
    <ul id="tools">
    <li class="totop-btn fa fa-angle-up"></li>
    <li class="exchange-btn fa fa-exchange"></li>
  
    <li class="toc-btn fa fa-list-ul"></li>
    
    

    
</ul>
<p id="process"></p>
<div id="search-overlay">
    <div class="search-area-wrap">
        <div id="search-area">
            <div class="input-wrap focus">
                <i class="fa fa-search" aria-hidden="true"></i>
                <input id="search-input" autofocus autocomplete="off" type="text"
                       placeholder="search this website..."/>
            </div>
            <ul id="search-result">
                <li class="load-first"><i class="fa fa-spinner fa-pulse"></i></li>
            </ul>
        </div>
    </div>
</div>

    <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#服务器端"><span class="toc-number">1.</span> <span class="toc-text">服务器端</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#查看包信息"><span class="toc-number">1.1.</span> <span class="toc-text">查看包信息</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#查看安装包生成的文件"><span class="toc-number">1.2.</span> <span class="toc-text">查看安装包生成的文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#查看hostname"><span class="toc-number">1.3.</span> <span class="toc-text">查看hostname</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#开机启动"><span class="toc-number">1.4.</span> <span class="toc-text">开机启动</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#检查iscsi是否启动"><span class="toc-number">1.5.</span> <span class="toc-text">检查iscsi是否启动</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#查看target信息"><span class="toc-number">1.6.</span> <span class="toc-text">查看target信息</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#客户端"><span class="toc-number">2.</span> <span class="toc-text">客户端</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#查看安装的文件"><span class="toc-number">2.1.</span> <span class="toc-text">查看安装的文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#创建挂载点"><span class="toc-number">2.2.</span> <span class="toc-text">创建挂载点</span></a></li></ol></li></ol>


    <script src="/js/highsong.js"></script>



<script src="/js/search.js"></script>
<script type="text/javascript">
    //theme config datas
    var copyrightObj = {};
    copyrightObj.enable = 'true';
    copyrightObj.triggerCopyLength = '200';
    copyrightObj.appendText = '商业转载请联系作者获得授权,非商业转载请注明出处 © gasslinks.com';
    var leancloudObj = {};
    leancloudObj.enable = 'true';
    leancloudObj.className = 'blog';
    leancloudObj.limits = '5';
</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?dfebe5842f5d4196471b84802392a4b2";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/javascript">
    var search = {};
    var search_path = "search.xml";
    if (!search_path) {
        search_path = "search.xml";
    }
    search.path = "/" + search_path;
    search.func =  _ajax.init();
</script>
<script src="/js/app.js"></script>


</body>
</html>